import request from '@/utils/request.js'

const getArticleListAPI = ({ channelId, timestamp = new Date().getTime() + '' }) => request({
  url: '/v1_0/articles',
  params: {
    channel_id: channelId,
    timestamp
  }
})
const articleDislikeAPI = ({ target }) => request({
  method: 'POST',
  url: '/v1_0/article/dislikes',
  data: {
    target
  }
})
const articleReportsAPI = ({ target, type, remark }) => request({
  method: 'POST',
  url: '/v1_0/article/reports',
  data: {
    target,
    type,
    remark: type === '0' ? remark : remark || null
  }
})
export {
  getArticleListAPI,
  articleDislikeAPI,
  articleReportsAPI
}
